= form_for [:admin,@<%= singular_table_name %>],html:{class:'form-horizontal'} do |f|
  - if @<%= singular_table_name %>.errors.any?
    #error_explanation
      h2 = "#{@<%= singular_table_name %>.errors.count}个错误需要修正"
      ul
        - @<%= singular_table_name %>.errors.full_messages.each do |message|
          li = message

<% attributes.each do |attribute| -%>
  .form-group
    = f.label :<%= attribute.name %>,class:'col-sm-2 control-label'
    .col-sm-10
      = f.<%= attribute.field_type %> :<%= attribute.name %>,class:'form-control'
<% end -%>
  .form-group
    .col-sm-12.col-sm-offset-2
      = f.submit '保存',class:'btn btn-primary'
